﻿using System;

namespace l1cs.server.serverpackets
{
    public class S_SkillSound : ServerBasePacket
    {
        private byte[] _byte = null;

        public S_SkillSound( int objid, int gfxid, int aid )
        {

            buildPacket( objid, gfxid, aid );
        }

        public S_SkillSound( int objid, int gfxid )
        {
            buildPacket( objid, gfxid, 0 );
        }

        private void buildPacket( int objid, int gfxid, int aid )
        {
            // aidは使われていない
            writeC( Opcodes.S_OPCODE_SKILLSOUNDGFX );
            writeD( objid );
            writeH( gfxid );
            writeH( 0 );
            writeD( 0x00000000 );
        }

        override
        public byte[] getContent()
        {
            if ( _byte == null )
            {
                _byte = getBytes();
            }

            return _byte;
        }

        override
        public String getType()
        {
            return "[S] S_SkillSound";
        }
    }
}
